<?php
$cs = Yii::app()->clientScript;
$cs->scriptMap["jquery.js"] = Yii::app()->theme->baseUrl . "/assets/js/jquery.js";
$cs->scriptMap["jquery.min.js"] = $cs->scriptMap["jquery.js"];
$cs->scriptMap["jquery.ba-bbq.js"] = Yii::app()->theme->baseUrl . "/assets/js/jquery.ba-bbq.min.js";
$cs->registerCoreScript('jquery');
//$cs->registerScriptFile(Yii::app()->theme->baseUrl . "/assets/js/bootstrap.min.js", CClientScript::POS_END);
$cs->registerScriptFile(Yii::app()->theme->baseUrl . "/assets/js/main.js", CClientScript::POS_END);
?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
        <meta name="description" content="">
        <meta name="author" content="">
        <link href="<?php echo Yii::app()->theme->baseUrl; ?>/assets/css/bootstrap.min.css" rel="stylesheet">   
        <link href="<?php echo Yii::app()->theme->baseUrl; ?>/assets/style.css" rel="stylesheet">
        <!--[if lt IE 9]>
        <script src="<?php echo Yii::app()->theme->baseUrl . "/assets/js/html5shiv.js"; ?>"></script>
        <script src="<?php echo Yii::app()->theme->baseUrl . "/assets/js/respond.min.js"; ?>"></script>
        <![endif]-->
        <script>var baseUrl = "<?php echo Yii::app()->baseUrl; ?>";</script>
        <title><?php echo CHtml::encode($this->pageTitle); ?></title>
    </head>
    <body>
        <div class="abu">
            <div class="container">
                <div class="row">
                    <div class="col-md-8 col-md-offset-3">
                        <div class="logo">
                            <img class="img-responsive" src="<?php echo Yii::app()->theme->baseUrl . "/assets/images/logo.png"; ?>">
                        </div>
                        <p class="title">
                        <h5><strong>DIREKTORAT PEMBINAAN USAHA HILIR MINYAK DAN GAS BUMI</strong></h5>
                        <h4><strong>KEMENTERIAN ENERGI DAN SUMBER DAYA MINERAL</strong></h4>
                        </p>
                    </div>
                </div>
            </div>
        </div>
        <div class="content">
            <?php if (!empty($this->breadcrumbs)) {?>
                <div class="container">
                    <div class="row  bg-breadcrumb">
                        <div class="col-md-8">
                            <?php
                            $this->widget('booster.widgets.TbBreadcrumbs', array(
                                'links' => $this->breadcrumbs,
                                'tagName' => 'ol',
                            ));
                            ?>
                        </div>
                        <div class="col-md-4 logout">
                        <?php 
                        if(Yii::app()->user->isOperatorMB())
                            $id = 1;
                        elseif(Yii::app()->user->isOperatorGB())
                            $id = 2;
                        elseif(Yii::app()->user->isOperatorHO())
                            $id = 3;
                        else
                            $id = '';
                        $this->widget('zii.widgets.CMenu',array(
                            'htmlOptions'=>array('class'=>'nav navbar-nav pull-right'),
                            'items'=>array(
                                array('label'=>'Administrasi', 'url'=>array('/izin/operator/'.$id), 'visible'=>!Yii::app()->user->isAdmin() && !Yii::app()->user->isGuest),
                                array('label'=>'Administrasi', 'url'=>array('/izin/admin'), 'visible'=>Yii::app()->user->isAdmin()),
                                array('label'=>'Login', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
                                array('label'=>'Logout ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest)
                            ),
                        )); ?>
                        </div>
                    </div>
                </div>
            <?php } ?>
            <?php echo $content; ?>
        </div>        
        <div class="footer">
            <div class="container">
                <p style="text-align: center"><strong><?php echo Yii::t('view','2014. Database Berkas Izin Usaha Pengolahan Migas');?></strong></p>
            </div>
        </div>
    </body>
</html>